<!DOCTYPE HTML>
<html lang="zh">
<head>
<title>Nginx 中文文档 - Compatibility | Docs4dev</title>
<meta charset="UTF-8">
<meta content="text/html; charset=utf-8" http-equiv="Content-Type">
<meta name="description" content="Nginx (engine x) 是一个高性能的HTTP和反向代理服务，也是一个IMAP/POP3/SMTP服务。">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="HandheldFriendly" content="true">
<meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no">
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="apple-mobile-web-app-status-bar-style" content="black">
<meta property="og:type" content="website">
<meta property="og:title" content="Nginx 中文文档 - Compatibility">
<meta property="og:url" content="https://www.docs4dev.com/docs/zh/nginx/current/reference/njs-compatibility.html">
<meta property="og:site_name" content="Docs4dev">
<meta property="og:locale" content="zh_CN">
<meta name="twitter:card" content="Nginx (engine x) 是一个高性能的HTTP和反向代理服务，也是一个IMAP/POP3/SMTP服务。">
<meta name="generator" content="Docs4dev template engine">
<link rel="stylesheet" href="static/css/app.min.css">
<link rel="shortcut icon" href="https://www.docs4dev.com/static/images/favicon.ico" type="image/x-icon">
<script async="" src="static/js/js.js"></script>
<script async="" src="static/js/adsbygoogle.js" crossorigin="anonymous"></script>
<script>
    window.dataLayer = window.dataLayer || [];

    function gtag() {
      dataLayer.push(arguments);
    }

    gtag('js', new Date());
    gtag('config', 'UA-129571937-1');
  </script>
<link rel="amphtml" href="https://www.docs4dev.com/amp/docs/zh/nginx/current/reference/njs-compatibility.html">
<script type="application/ld+json">{"name":null,"headline":"Nginx 中文文档-Compatibility","inLanguage":"zh-CN","version":"current","image":"/static/icon/icon-nginx.svg","datePublished":"2021-05-20T12:51:01Z","dateCreated":"2021-05-20T12:51:01Z","dateModified":"2021-07-07T12:48:29Z","@context":"https://schema.org/","@type":"APIReference","abstract":"Nginx (engine x) 是一个高性能的HTTP和反向代理服务，也是一个IMAP/POP3/SMTP服务。"}</script>
</head>
<body>
<div class="book with-summary">
<div class="book-summary">
<div class="logo">
<a href="index.html" style="color: inherit;">
<img src="static/picture/icon-nginx.svg" style="width: 48px; height: 48px;" alt="Logo">
</a>
<b style="color: inherit; margin-left: 8px;">Nginx 中文文档</b>
</div>
<div class="item">
<div>
<label for="version">版本</label>
<select id="version" onchange="onVersionChange(this)">
<option value="current" selected="selected">current</option>
</select>
</div>
<div style="margin-top: 8px;">
<label for="language">语言</label>
<select id="language" onchange="onLangChange(this)" value="zh">
<option value="en">English</option>
<option value="zh" selected="selected">中文</option>
</select>
</div>

</div>
<div class="item menus">
<a title="Table of Contents" style="margin-right: 8px;" href="index.html">
<i class="fa fa-chevron-left"></i>
<span style="margin-left: 2px;">返回目录</span>
</a>
</div>
<nav role="navigation" id="navigation">
<ul class="summary">
<li class="chapter"> <a href="install.html" title="Introduction"> Introduction </a>
<ul class="articles">
<li class="chapter"> <a href="install.html" title="Installing nginx"> Installing nginx </a> </li>
<li class="chapter"> <a href="configure.html" title="从源代码构建  Nginx"> 从源代码构建 Nginx </a> </li>
<li class="chapter"> <a href="beginners_guide.html" title="Beginner's Guide"> Beginner's Guide </a> </li>
<li class="chapter"> <a href="control.html" title="Controlling nginx"> Controlling nginx </a> </li>
<li class="chapter"> <a href="events.html" title="连接处理方法"> 连接处理方法 </a> </li>
<li class="chapter"> <a href="hash.html" title="设置哈希"> 设置哈希 </a> </li>
<li class="chapter"> <a href="debugging_log.html" title="调试日志"> 调试日志 </a> </li>
<li class="chapter"> <a href="syslog.html" title="记录到系统日志"> 记录到系统日志 </a> </li>
<li class="chapter"> <a href="syntax.html" title="配置文件测量单位"> 配置文件测量单位 </a> </li>
<li class="chapter"> <a href="switches.html" title="Command-line parameters"> Command-line parameters </a> </li>
<li class="chapter"> <a href="windows.html" title="Windows 版  Nginx"> Windows 版 Nginx </a> </li>
<li class="chapter"> <a href="http-request_processing.html" title="Nginx 如何处理请求"> Nginx 如何处理请求 </a> </li>
<li class="chapter"> <a href="http-server_names.html" title="Server names"> Server names </a> </li>
<li class="chapter"> <a href="http-load_balancing.html" title="使用  Nginx 作为  HTTP 负载均衡器"> 使用 Nginx 作为 HTTP 负载均衡器 </a> </li>
<li class="chapter"> <a href="http-configuring_https_servers.html" title="配置  HTTPS 服务器"> 配置 HTTPS 服务器 </a> </li>
<li class="chapter"> <a href="stream-stream_processing.html" title="Nginx 如何处理  TCP/UDP 会话"> Nginx 如何处理 TCP/UDP 会话 </a> </li>
<li class="chapter"> <a href="njs-index.html" title="用  njs 编写脚本"> 用 njs 编写脚本 </a> </li>
</ul> </li>
<li class="chapter"> <a href="howto_build_on_win32.html" title="How-To"> How-To </a>
<ul class="articles">
<li class="chapter"> <a href="howto_build_on_win32.html" title="使用  Visual C 在  Win32 平台上构建  Nginx"> 使用 Visual C 在 Win32 平台上构建 Nginx </a> </li>
<li class="chapter"> <a href="nginx_dtrace_pid_provider.html" title="使用  DTrace pid 提供程序调试  nginx"> 使用 DTrace pid 提供程序调试 nginx </a> </li>
<li class="chapter"> <a href="http-converting_rewrite_rules.html" title="转换重写规则"> 转换重写规则 </a> </li>
<li class="chapter"> <a href="http-websocket.html" title="WebSocket proxying"> WebSocket proxying </a> </li>
</ul> </li>
<li class="chapter"> <a href="contributing_changes.html" title="Development"> Development </a>
<ul class="articles">
<li class="chapter"> <a href="contributing_changes.html" title="Contributing Changes"> Contributing Changes </a> </li>
<li class="chapter"> <a href="dev-development_guide.html" title="Development guide"> Development guide </a> </li>
</ul> </li>
<li class="chapter"> <a href="dirindex.html" title="Modules reference"> Modules reference </a>
<ul class="articles">
<li class="chapter"> <a href="dirindex.html" title="指令的字母索引"> 指令的字母索引 </a> </li>
<li class="chapter"> <a href="varindex.html" title="变量按字母顺序索引"> 变量按字母顺序索引 </a> </li>
<li class="chapter"> <a href="ngx_core_module.html" title="Core functionality"> Core functionality </a> </li>
<li class="chapter"> <a href="http-ngx_http_core_module.html" title="ngx_http_core_module"> ngx_http_core_module </a> </li>
<li class="chapter"> <a href="http-ngx_http_access_module.html" title="ngx_http_access_module"> ngx_http_access_module </a> </li>
<li class="chapter"> <a href="http-ngx_http_addition_module.html" title="ngx_http_addition_module"> ngx_http_addition_module </a> </li>
<li class="chapter"> <a href="http-ngx_http_api_module.html" title="ngx_http_api_module"> ngx_http_api_module </a> </li>
<li class="chapter"> <a href="http-ngx_http_auth_basic_module.html" title="ngx_http_auth_basic_module"> ngx_http_auth_basic_module </a> </li>
<li class="chapter"> <a href="http-ngx_http_auth_jwt_module.html" title="ngx_http_auth_jwt_module"> ngx_http_auth_jwt_module </a> </li>
<li class="chapter"> <a href="http-ngx_http_auth_request_module.html" title="ngx_http_auth_request_module"> ngx_http_auth_request_module </a> </li>
<li class="chapter"> <a href="http-ngx_http_autoindex_module.html" title="ngx_http_autoindex_module"> ngx_http_autoindex_module </a> </li>
<li class="chapter"> <a href="http-ngx_http_browser_module.html" title="ngx_http_browser_module"> ngx_http_browser_module </a> </li>
<li class="chapter"> <a href="http-ngx_http_charset_module.html" title="ngx_http_charset_module"> ngx_http_charset_module </a> </li>
<li class="chapter"> <a href="http-ngx_http_dav_module.html" title="ngx_http_dav_module"> ngx_http_dav_module </a> </li>
<li class="chapter"> <a href="http-ngx_http_empty_gif_module.html" title="ngx_http_empty_gif_module"> ngx_http_empty_gif_module </a> </li>
<li class="chapter"> <a href="http-ngx_http_f4f_module.html" title="ngx_http_f4f_module"> ngx_http_f4f_module </a> </li>
<li class="chapter"> <a href="http-ngx_http_fastcgi_module.html" title="ngx_http_fastcgi_module"> ngx_http_fastcgi_module </a> </li>
<li class="chapter"> <a href="http-ngx_http_flv_module.html" title="ngx_http_flv_module"> ngx_http_flv_module </a> </li>
<li class="chapter"> <a href="http-ngx_http_geo_module.html" title="ngx_http_geo_module"> ngx_http_geo_module </a> </li>
<li class="chapter"> <a href="http-ngx_http_geoip_module.html" title="ngx_http_geoip_module"> ngx_http_geoip_module </a> </li>
<li class="chapter"> <a href="http-ngx_http_grpc_module.html" title="ngx_http_grpc_module"> ngx_http_grpc_module </a> </li>
<li class="chapter"> <a href="http-ngx_http_gunzip_module.html" title="ngx_http_gunzip_module"> ngx_http_gunzip_module </a> </li>
<li class="chapter"> <a href="http-ngx_http_gzip_module.html" title="ngx_http_gzip_module"> ngx_http_gzip_module </a> </li>
<li class="chapter"> <a href="http-ngx_http_gzip_static_module.html" title="ngx_http_gzip_static_module"> ngx_http_gzip_static_module </a> </li>
<li class="chapter"> <a href="http-ngx_http_headers_module.html" title="ngx_http_headers_module"> ngx_http_headers_module </a> </li>
<li class="chapter"> <a href="http-ngx_http_hls_module.html" title="ngx_http_hls_module"> ngx_http_hls_module </a> </li>
<li class="chapter"> <a href="http-ngx_http_image_filter_module.html" title="ngx_http_image_filter_module"> ngx_http_image_filter_module </a> </li>
<li class="chapter"> <a href="http-ngx_http_index_module.html" title="ngx_http_index_module"> ngx_http_index_module </a> </li>
<li class="chapter"> <a href="http-ngx_http_js_module.html" title="ngx_http_js_module"> ngx_http_js_module </a> </li>
<li class="chapter"> <a href="http-ngx_http_keyval_module.html" title="ngx_http_keyval_module"> ngx_http_keyval_module </a> </li>
<li class="chapter"> <a href="http-ngx_http_limit_conn_module.html" title="ngx_http_limit_conn_module"> ngx_http_limit_conn_module </a> </li>
<li class="chapter"> <a href="http-ngx_http_limit_req_module.html" title="ngx_http_limit_req_module"> ngx_http_limit_req_module </a> </li>
<li class="chapter"> <a href="http-ngx_http_log_module.html" title="ngx_http_log_module"> ngx_http_log_module </a> </li>
<li class="chapter"> <a href="http-ngx_http_map_module.html" title="ngx_http_map_module"> ngx_http_map_module </a> </li>
<li class="chapter"> <a href="http-ngx_http_memcached_module.html" title="ngx_http_memcached_module"> ngx_http_memcached_module </a> </li>
<li class="chapter"> <a href="http-ngx_http_mirror_module.html" title="ngx_http_mirror_module"> ngx_http_mirror_module </a> </li>
<li class="chapter"> <a href="http-ngx_http_mp4_module.html" title="ngx_http_mp4_module"> ngx_http_mp4_module </a> </li>
<li class="chapter"> <a href="http-ngx_http_perl_module.html" title="ngx_http_perl_module"> ngx_http_perl_module </a> </li>
<li class="chapter"> <a href="http-ngx_http_proxy_module.html" title="ngx_http_proxy_module"> ngx_http_proxy_module </a> </li>
<li class="chapter"> <a href="http-ngx_http_random_index_module.html" title="ngx_http_random_index_module"> ngx_http_random_index_module </a> </li>
<li class="chapter"> <a href="http-ngx_http_realip_module.html" title="ngx_http_realip_module"> ngx_http_realip_module </a> </li>
<li class="chapter"> <a href="http-ngx_http_referer_module.html" title="ngx_http_referer_module"> ngx_http_referer_module </a> </li>
<li class="chapter"> <a href="http-ngx_http_rewrite_module.html" title="ngx_http_rewrite_module"> ngx_http_rewrite_module </a> </li>
<li class="chapter"> <a href="http-ngx_http_scgi_module.html" title="ngx_http_scgi_module"> ngx_http_scgi_module </a> </li>
<li class="chapter"> <a href="http-ngx_http_secure_link_module.html" title="ngx_http_secure_link_module"> ngx_http_secure_link_module </a> </li>
<li class="chapter"> <a href="http-ngx_http_session_log_module.html" title="ngx_http_session_log_module"> ngx_http_session_log_module </a> </li>
<li class="chapter"> <a href="http-ngx_http_slice_module.html" title="ngx_http_slice_module"> ngx_http_slice_module </a> </li>
<li class="chapter"> <a href="http-ngx_http_spdy_module.html" title="ngx_http_spdy_module"> ngx_http_spdy_module </a> </li>
<li class="chapter"> <a href="http-ngx_http_split_clients_module.html" title="ngx_http_split_clients_module"> ngx_http_split_clients_module </a> </li>
<li class="chapter"> <a href="http-ngx_http_ssi_module.html" title="ngx_http_ssi_module"> ngx_http_ssi_module </a> </li>
<li class="chapter"> <a href="http-ngx_http_ssl_module.html" title="ngx_http_ssl_module"> ngx_http_ssl_module </a> </li>
<li class="chapter"> <a href="http-ngx_http_status_module.html" title="ngx_http_status_module"> ngx_http_status_module </a> </li>
<li class="chapter"> <a href="http-ngx_http_stub_status_module.html" title="ngx_http_stub_status_module"> ngx_http_stub_status_module </a> </li>
<li class="chapter"> <a href="http-ngx_http_sub_module.html" title="ngx_http_sub_module"> ngx_http_sub_module </a> </li>
<li class="chapter"> <a href="http-ngx_http_upstream_module.html" title="ngx_http_upstream_module"> ngx_http_upstream_module </a> </li>
<li class="chapter"> <a href="http-ngx_http_upstream_conf_module.html" title="ngx_http_upstream_conf_module"> ngx_http_upstream_conf_module </a> </li>
<li class="chapter"> <a href="http-ngx_http_upstream_hc_module.html" title="ngx_http_upstream_hc_module"> ngx_http_upstream_hc_module </a> </li>
<li class="chapter"> <a href="http-ngx_http_userid_module.html" title="ngx_http_userid_module"> ngx_http_userid_module </a> </li>
<li class="chapter"> <a href="http-ngx_http_uwsgi_module.html" title="ngx_http_uwsgi_module"> ngx_http_uwsgi_module </a> </li>
<li class="chapter"> <a href="http-ngx_http_v2_module.html" title="ngx_http_v2_module"> ngx_http_v2_module </a> </li>
<li class="chapter"> <a href="http-ngx_http_xslt_module.html" title="ngx_http_xslt_module"> ngx_http_xslt_module </a> </li>
<li class="chapter"> <a href="mail-ngx_mail_core_module.html" title="ngx_mail_core_module"> ngx_mail_core_module </a> </li>
<li class="chapter"> <a href="mail-ngx_mail_auth_http_module.html" title="ngx_mail_auth_http_module"> ngx_mail_auth_http_module </a> </li>
<li class="chapter"> <a href="mail-ngx_mail_proxy_module.html" title="ngx_mail_proxy_module"> ngx_mail_proxy_module </a> </li>
<li class="chapter"> <a href="mail-ngx_mail_ssl_module.html" title="ngx_mail_ssl_module"> ngx_mail_ssl_module </a> </li>
<li class="chapter"> <a href="mail-ngx_mail_imap_module.html" title="ngx_mail_imap_module"> ngx_mail_imap_module </a> </li>
<li class="chapter"> <a href="mail-ngx_mail_pop3_module.html" title="ngx_mail_pop3_module"> ngx_mail_pop3_module </a> </li>
<li class="chapter"> <a href="mail-ngx_mail_smtp_module.html" title="ngx_mail_smtp_module"> ngx_mail_smtp_module </a> </li>
<li class="chapter"> <a href="stream-ngx_stream_core_module.html" title="ngx_stream_core_module"> ngx_stream_core_module </a> </li>
<li class="chapter"> <a href="stream-ngx_stream_access_module.html" title="ngx_stream_access_module"> ngx_stream_access_module </a> </li>
<li class="chapter"> <a href="stream-ngx_stream_geo_module.html" title="ngx_stream_geo_module"> ngx_stream_geo_module </a> </li>
<li class="chapter"> <a href="stream-ngx_stream_geoip_module.html" title="ngx_stream_geoip_module"> ngx_stream_geoip_module </a> </li>
<li class="chapter"> <a href="stream-ngx_stream_js_module.html" title="ngx_stream_js_module"> ngx_stream_js_module </a> </li>
<li class="chapter"> <a href="stream-ngx_stream_keyval_module.html" title="ngx_stream_keyval_module"> ngx_stream_keyval_module </a> </li>
<li class="chapter"> <a href="stream-ngx_stream_limit_conn_module.html" title="ngx_stream_limit_conn_module"> ngx_stream_limit_conn_module </a> </li>
<li class="chapter"> <a href="stream-ngx_stream_log_module.html" title="ngx_stream_log_module"> ngx_stream_log_module </a> </li>
<li class="chapter"> <a href="stream-ngx_stream_map_module.html" title="ngx_stream_map_module"> ngx_stream_map_module </a> </li>
<li class="chapter"> <a href="stream-ngx_stream_proxy_module.html" title="ngx_stream_proxy_module"> ngx_stream_proxy_module </a> </li>
<li class="chapter"> <a href="stream-ngx_stream_realip_module.html" title="ngx_stream_realip_module"> ngx_stream_realip_module </a> </li>
<li class="chapter"> <a href="stream-ngx_stream_return_module.html" title="ngx_stream_return_module"> ngx_stream_return_module </a> </li>
<li class="chapter"> <a href="stream-ngx_stream_split_clients_module.html" title="ngx_stream_split_clients_module"> ngx_stream_split_clients_module </a> </li>
<li class="chapter"> <a href="stream-ngx_stream_ssl_module.html" title="ngx_stream_ssl_module"> ngx_stream_ssl_module </a> </li>
<li class="chapter"> <a href="stream-ngx_stream_ssl_preread_module.html" title="ngx_stream_ssl_preread_module"> ngx_stream_ssl_preread_module </a> </li>
<li class="chapter"> <a href="stream-ngx_stream_upstream_module.html" title="ngx_stream_upstream_module"> ngx_stream_upstream_module </a> </li>
<li class="chapter"> <a href="stream-ngx_stream_upstream_hc_module.html" title="ngx_stream_upstream_hc_module"> ngx_stream_upstream_hc_module </a> </li>
<li class="chapter"> <a href="stream-ngx_stream_zone_sync_module.html" title="ngx_stream_zone_sync_module"> ngx_stream_zone_sync_module </a> </li>
<li class="chapter"> <a href="ngx_google_perftools_module.html" title="ngx_google_perftools_module"> ngx_google_perftools_module </a> </li>
</ul> </li>
</ul>
</nav>
</div>
<div class="book-body">
<div class="body-inner">
<header class="book-header">
<div class="dropdown pull-right js-toolbar-action">
<a class="btn toggle-dropdown" aria-label="Language" href="#">
<i class="fa fa-globe"></i>
</a>
<div class="dropdown-menu dropdown-left">
<div class="dropdown-caret"><span class="caret-outer"></span><span class="caret-inner"></span></div>
<div class="buttons">
<button class="button size-1" onclick="changeLang('zh_CN')">中文</button>
</div>
<div class="buttons">
<button class="button size-1" onclick="changeLang('en_US')">English</button>
</div>
</div>
</div>
<a class="btn pull-right js-toolbar-action non-mobile" aria-label="Sign up" href="register.html">
<i class="fa fa-sign-in"></i> <span>注册</span>
</a>
<a class="btn pull-right js-toolbar-action non-mobile" aria-label="Sign in" href="register.html">
<i class="fa fa-sign-in"></i>
<span>登录</span>
</a>
<a class="btn pull-left js-toolbar-action btn-summary" href="#"><i class="fa fa-align-justify"></i></a>
<div class="dropdown pull-left font-settings js-toolbar-action">
<a class="btn toggle-dropdown" aria-label="Font Settings" href="#">
<i class="fa fa-font"></i>
</a>
<div class="dropdown-menu dropdown-right">
<div class="dropdown-caret"><span class="caret-outer"></span><span class="caret-inner"></span></div>
<div class="buttons">
<button class="button size-2 font-reduce">A</button>
<button class="button size-2 font-enlarge">A</button>
</div>
<div class="buttons">
<button class="button size-2 family-serif">Serif</button>
<button class="button size-2 family-sans">Sans</button>
</div>
<div class="buttons">
<button class="button size-3 theme-white">White</button>
<button class="button size-3 theme-sepia">Sepia</button>
<button class="button size-3 theme-night">Night</button>
</div>
</div>
</div>
<a class="btn pull-left js-toolbar-action non-mobile" aria-label="Home" href="zh.html">
<i class="fa fa-home"></i> <span>首页</span>
</a>
<a class="btn pull-left js-toolbar-action non-mobile" aria-label="Guide" href="javascript:window.open('https://www.javadoc.org/');">
<i class="fa fa-book"></i> <span>API Docs</span>
</a>
<a class="btn pull-left js-toolbar-action non-mobile" aria-label="Tools" href="index1.html">
<i class="fa fa-gears"></i> <span>工具</span>
</a>
<div class="dropdown pull-left js-toolbar-action mobile">
<a class="btn toggle-dropdown" aria-label="Language" href="#">
<i class="fa fa-chevron-down"></i>
</a>
<div class="dropdown-menu dropdown-right">
<div class="dropdown-caret"><span class="caret-outer"></span><span class="caret-inner"></span></div>
<div class="buttons">
<a class="button size-1" aria-label="Home" href="zh.html">
<i class="fa fa-home"></i> <span>首页</span>
</a>
</div>
<div class="buttons">
<a class="button size-1" aria-label="Guide" href="javascript:window.open('https://www.javadoc.org/');">
<i class="fa fa-book"></i> <span>API Docs</span>
</a>
</div>
<div class="buttons">
<a class="button size-1" aria-label="Tools" href="index1.html">
<i class="fa fa-gears"></i> <span>工具</span>
</a>
</div>
</div>
</div>
<div id="autocomplete" class="pull-right"></div>
<span id="toolbar-title"></span>
</header>
<div class="page-wrapper" tabindex="-1" role="main">
<div class="page-inner">
<section class="normal markdown-section">
<div id="content">
<h1>Compatibility</h1>
<div><ins class="adsbygoogle" style="display:block; text-align:center;" data-ad-layout="in-article" data-ad-format="fluid" data-ad-client="ca-pub-6108808167664152" data-ad-slot="6964403648"></ins>
<script>
(adsbygoogle = window.adsbygoogle || []).push({});
</script></div>
<div><p>njs 是根据<a href="javascript:window.open('https://www.ecma-international.org/ecma-262/5.1/');" target="_blank" rel="noopener noreferrer">ECMAScript 5.1</a>(严格模式)和某些<a href="javascript:window.open('https://www.ecma-international.org/ecma-262/6.0/');" target="_blank" rel="noopener noreferrer">ECMAScript 6</a>及更高版本的 extensions 创建的。合规性还在不断 Developing。</p>
<p>可以在<a href="njs-reference.html">Reference</a>中找到不符合 ECMAScript 的 njs 特定属性和方法的定义。可以在<a href="javascript:window.open('https://www.ecma-international.org/ecma-262/');" target="_blank" rel="noopener noreferrer">ECMAScript specification</a>中找到与 ECMAScript 兼容的 njs 属性和方法的定义。</p>
<p><a href="" id="supported"></a></p>
<h4 id="目前支持什么"><a href="#目前支持什么" id="目前支持什么"></a>目前支持什么</h4>
<ul>
<li>
<p>布尔值，数字，字符串，对象，数组，函数，函数构造函数(<a href="njs-changes.html#njs0.3.6">0.3.6</a>)和正则表达式</p>
</li>
<li>
<p>ES5.1 运算符，ES7 指数运算符</p>
</li>
<li>
<p>ES5.1 语句：<code>break</code>，<code>catch</code>，<code>continue</code>，<code>do while</code>，<code>else</code>，<code>finally</code>，<code>for</code>，<code>for in</code>，<code>if</code>，<code>return</code>，<code>switch</code>，<code>throw</code>，<code>try</code>，<code>var</code>，<code>while</code>，带标记的语句(<a href="njs-changes.html#njs0.2.8">0.2.8</a>)</p>
</li>
<li>
<p><code>Math</code>个属性：</p>
</li>
<li>
<p>ES6：<code>E</code>，<code>LN10</code>，<code>LN2</code>，<code>LOG10E</code>，<code>LOG2E</code>，<code>PI</code>，<code>SQRT1_2</code>，<code>SQRT2</code></p>
</li>
<li>
<p><code>Math</code>个方法：</p>
</li>
<li>
<p>ES6：<code>abs</code>，<code>acos</code>，<code>acosh</code>，<code>asin</code>，<code>asinh</code>，<code>atan</code>，<code>atan2</code>，<code>atanh</code>，<code>cbrt</code>，<code>ceil</code>，<code>clz32</code>，<code>cos</code>，<code>cosh</code>，<code>exp</code>，<code>expm1</code>，<code>floor</code>，<code>fround</code>，<code>hypot</code>，_ _21，_21，<code>imul</code> <code>min</code>，<code>pow</code>，<code>random</code>，<code>round</code>，<code>sign</code>，<code>sin</code>，<code>sinh</code>，<code>sqrt</code>，<code>tan</code>，<code>tanh</code>，<code>trunc</code></p>
</li>
<li>
<p><code>Number</code>个属性：</p>
</li>
<li>
<p>ES6：<code>EPSILON</code>，<code>MAX_SAFE_INTEGER</code>，<code>MAX_VALUE</code>，<code>MIN_SAFE_INTEGER</code>，<code>MIN_VALUE</code>，<code>NEGATIVE_INFINITY</code>，<code>NaN</code>，<code>POSITIVE_INFINITY</code></p>
</li>
<li>
<p><code>Number</code>个方法：</p>
</li>
<li>
<p>ES6：<code>isFinite</code>，<code>isInteger</code>，<code>isNaN</code>，<code>isSafeInteger</code>，<code>parseFloat</code>，<code>parseInt</code></p>
</li>
<li>
<p><code>Number</code>个实例方法：</p>
</li>
<li>
<p>ES6：<code>toExponential</code>(<a href="njs-changes.html#njs0.3.6">0.3.6</a>)，<code>toFixed</code>(<a href="njs-changes.html#njs0.3.6">0.3.6</a>)，<code>toPrecision</code>(<a href="njs-changes.html#njs0.3.6">0.3.6</a>)</p>
</li>
<li>
<p><code>String</code>个方法：</p>
</li>
<li>
<p>ES5.1：<code>fromCharCode</code></p>
<ul>
<li>ES6：<code>fromCodePoint</code></li>
</ul>
</li>
<li>
<p><code>String</code>个实例方法：</p>
</li>
<li>
<p>ES5.1：<code>charAt</code>，<code>concat</code>，<code>indexOf</code>&gt;，<code>lastIndexOf</code>，<code>match</code>，<code>replace</code>，<code>search</code>，<code>slice</code>，<code>split</code>，<code>substr</code>，<code>substring</code>，<code>toLowerCase</code>，<code>trim</code>，<code>toUpperCase</code></p>
<ul>
<li>
<p>ES6：<code>codePointAt</code>，<code>endsWith</code>，<code>includes</code>，<code>repeat</code>，<code>startsWith</code></p>
</li>
<li>
<p>ES8：<code>padEnd</code>，<code>padStart</code></p>
</li>
<li>
<p>ES9：<code>trimEnd</code>(<a href="njs-changes.html#njs0.3.4">0.3.4</a>)，<code>trimStart</code>(<a href="njs-changes.html#njs0.3.4">0.3.4</a>)</p>
</li>
<li>
<p>非标准：<a href="njs-reference.html#string_bytesfrom">bytesFrom</a>(<a href="njs-changes.html#njs0.2.3">0.2.3</a>)，<a href="njs-reference.html#string_frombytes">fromBytes</a>，<a href="njs-reference.html#string_fromutf8">fromUTF8</a>，<a href="njs-reference.html#string_tobytes">toBytes</a>，<a href="njs-reference.html#string_toutf8">toUTF8</a></p>
</li>
</ul>
</li>
<li>
<p><code>Object</code>个方法：</p>
</li>
<li>
<p>ES5.1：<code>create</code>(不带属性列表的支持)，<code>defineProperties</code>(自<a href="njs-changes.html#njs0.3.3">0.3.3</a>以来支持访问 Descriptors)，<code>defineProperty</code>(自<a href="njs-changes.html#njs0.3.3">0.3.3</a>以来支持访问 Descriptors)，<code>freeze</code>，<code>getOwnPropertyDescriptor</code>，<code>getOwnPropertyDescriptors</code>(<a href="njs-changes.html#njs0.3.1">0.3.1</a>)，<code>getOwnPropertyNames</code>(<a href="njs-changes.html#njs0.3.1">0.3.1</a>)，<code>getPrototypeOf</code>，<code>isExtensible</code>，<code>isFrozen</code> <code>isSealed</code>，<code>keys</code>，<code>preventExtensions</code>，<code>seal</code></p>
<ul>
<li>
<p>ES6：<code>assign</code>(<a href="njs-changes.html#njs0.3.7">0.3.7</a>)</p>
</li>
<li>
<p>ES8：<code>entries</code>(<a href="njs-changes.html#njs0.2.7">0.2.7</a>)，<code>values</code>(<a href="njs-changes.html#njs0.2.7">0.2.7</a>)</p>
</li>
</ul>
</li>
<li>
<p><code>Object</code>个实例方法：</p>
</li>
<li>
<p>ES5.1：<code>hasOwnProperty</code>，<code>isPrototypeOf</code>，(<a href="njs-changes.html#njs0.3.0">0.3.0</a>)，<code>propertyIsEnumerable</code>，<code>toString</code>，<code>valueOf</code></p>
<ul>
<li>ES6：<code>is</code>(<a href="njs-changes.html#njs0.3.8">0.3.8</a>)，<code>setPrototypeOf</code>(<a href="njs-changes.html#njs0.3.8">0.3.8</a>)</li>
</ul>
</li>
<li>
<p><code>Array</code>个方法：</p>
</li>
<li>
<p>ES5.1：<code>isArray</code></p>
<ul>
<li>ES6：<code>of</code></li>
</ul>
</li>
<li>
<p><code>Array</code>个实例方法：</p>
</li>
<li>
<p>ES5.1：<code>concat</code>，<code>every</code>，<code>filter</code>，<code>forEach</code>，<code>indexOf</code>，<code>join</code>，<code>lastIndexOf</code>，<code>map</code>，<code>pop</code>，<code>push</code>，<code>reduce</code>，<code>reduceRight</code>，<code>reverse</code>，<code>shift</code>，<code>slice</code>，<code>some</code>，<code>sort</code>，<code>splice</code>，<code>unshift</code></p>
<ul>
<li>
<p>ES6：<code>copyWithin</code>(<a href="njs-changes.html#njs0.3.7">0.3.7</a>)，<code>fill</code>，<code>find</code>，<code>findIndex</code></p>
</li>
<li>
<p>ES7：<code>includes</code></p>
</li>
</ul>
</li>
<li>
<p><code>ArrayBuffer</code>个方法(<a href="njs-changes.html#njs0.3.8">0.3.8</a>)：</p>
</li>
<li>
<p>ES6：<code>isView</code></p>
</li>
<li>
<p><code>ArrayBuffer</code>个实例方法(<a href="njs-changes.html#njs0.3.8">0.3.8</a>)：</p>
</li>
<li>
<p>ES6：<code>slice</code></p>
</li>
<li>
<p><code>Typed-array</code>个构造函数(<a href="njs-changes.html#njs0.3.8">0.3.8</a>)：</p>
</li>
<li>
<p>ES6：<code>Int8Array</code>，<code>Uint8Array</code>，<code>Uint8ClampedArray</code>，<code>Int16Array</code>，<code>Uint16Array</code>，<code>Int32Array</code>，<code>Uint32Array</code>，<code>Float32Array</code>，<code>Float64Array</code></p>
</li>
<li>
<p><code>Typed-array</code>个实例方法(<a href="njs-changes.html#njs0.3.8">0.3.8</a>)：</p>
</li>
<li>
<p>ES6：<code>copyWithin</code>，<code>fill</code>，<code>join</code>，<code>set</code>，<code>slice</code>，<code>sort</code>(<a href="njs-changes.html#njs0.4.2">0.4.2</a>)，<code>subarray</code>，<code>toString</code></p>
</li>
<li>
<p><code>Promise</code>个方法(<a href="njs-changes.html#njs0.3.8">0.3.8</a>)：</p>
</li>
<li>
<p>ES6：<code>reject</code>，<code>resolve</code></p>
</li>
<li>
<p><code>Promise</code>个实例方法(<a href="njs-changes.html#njs0.3.8">0.3.8</a>)：</p>
</li>
<li>
<p>ES6：<code>catch</code>，<code>finally</code>，<code>then</code></p>
</li>
<li>
<p><code>Function</code>个实例方法：</p>
</li>
<li>
<p>ES5.1：<code>apply</code>，<code>bind</code>，<code>call</code></p>
</li>
<li>
<p><code>RegExp</code>个实例方法：</p>
</li>
<li>
<p>ES5.1：<code>exec</code>，<code>test</code>，<code>toString</code></p>
</li>
<li>
<p><code>RegExp</code> ES9 命名捕获组(<a href="njs-changes.html#njs0.3.2">0.3.2</a>)</p>
</li>
<li>
<p><code>Date</code>个方法：</p>
</li>
<li>
<p>ES5.1：<code>now</code>，<code>parse</code>，<code>UTC</code></p>
</li>
<li>
<p><code>Date</code>个实例方法：</p>
</li>
<li>
<p>ES5.1：<code>getDate</code>，<code>getDay</code>，<code>getFullYear</code>，<code>getHours</code>，<code>getMilliseconds</code>，<code>getMinutes</code>，<code>getMonth</code>，<code>getSeconds</code>，<code>getTime</code>，<code>getTimezoneOffset</code>，<code>getUTCDate</code>，<code>getUTCDay</code>，<code>getUTCFullYear</code>，<code>getUTCHours</code>，<code>getUTCMilliseconds</code>，<code>getUTCMinutes</code>，<code>getUTCMonth</code>，<code>getUTCSeconds</code>，_ _21，<code>toDateString</code> <code>toTimeString</code>，<code>toUTCString</code>，<code>setDate</code>，<code>setFullYear</code>，<code>setHours</code>，<code>setMinutes</code>，<code>setMilliseconds</code>，<code>setMonth</code>，<code>setSeconds</code>，<code>setTime</code>，<code>setUTCDate</code>，<code>setUTCFullYear</code>，<code>setUTCHours</code>，<code>setUTCMilliseconds</code>，<code>setUTCMinutes</code>，<code>setUTCMonth</code>，<code>setUTCSeconds</code></p>
</li>
<li>
<p><code>JSON</code>个方法：</p>
</li>
<li>
<p>ES5.1：<code>parse</code> <code>stringify</code></p>
</li>
<li>
<p>ES5.1 <code>arguments</code>对象(<a href="njs-changes.html#njs0.2.5">0.2.5</a>)</p>
</li>
<li>
<p>ES6 其余参数语法(不支持解构)(<a href="njs-changes.html#njs0.2.7">0.2.7</a>)</p>
</li>
<li>
<p>ES5.1 全局功能：<code>decodeURI</code>，<code>decodeURIComponent</code>，<code>encodeURI</code>，<code>encodeURIComponent</code>，<code>isFinite</code>，<code>isNaN</code>，<code>parseFloat</code>，<code>parseInt</code></p>
</li>
<li>
<p><code>Error</code>个对象：<code>Error</code>，<code>EvalError</code>，<code>InternalError</code>，<code>RangeError</code>，<code>ReferenceError</code>，<code>SyntaxError</code>，<code>TypeError</code>，<code>URIError</code></p>
</li>
<li>
<p><a href="njs-reference.html#cleartimeout">clearTimeout</a>和<a href="njs-reference.html#settimeout">setTimeout</a>函数(<a href="njs-changes.html#njs0.2.0">0.2.0</a>)</p>
</li>
<li>
<p><code>File system</code>个方法：<a href="njs-reference.html#fs_accesssync">fs.accessSync</a>(<a href="njs-changes.html#njs0.3.9">0.3.9</a>)，<a href="njs-reference.html#appendfilesync">fs.appendFileSync</a>，<a href="njs-reference.html#fs_mkdirsync">fs.mkdirSync</a>(<a href="njs-changes.html#njs0.4.2">0.4.2</a>)，<a href="njs-reference.html#fs_readdirsync">fs.readdirSync</a>(<a href="njs-changes.html#njs0.4.2">0.4.2</a>)，<a href="njs-reference.html#readfilesync">fs.readFileSync</a>，<a href="njs-reference.html#fs_realpathsync">fs.realpathSync</a>(<a href="njs-changes.html#njs0.3.9">0.3.9</a>)，<a href="njs-reference.html#fs_renamesync">fs.renameSync</a>(<a href="njs-changes.html#njs0.3.4">0.3.4</a>)，<a href="njs-reference.html#fs_rmdirsync">fs.rmdirSync</a>(<a href="njs-changes.html#njs0.4.2">0.4.2</a>)，<a href="njs-reference.html#fs_symlinksync">fs.symlinkSync</a>(<a href="njs-changes.html#njs0.3.9">0.3.9</a>)</p>
</li>
<li>
<p><code>fs.promises</code> API(<a href="njs-changes.html#fs_unlinksync">0.3.9</a>)，文件系统方法的异步版本。</p>
</li>
<li>
<p><code>Crypto</code>个方法(<a href="njs-changes.html#njs0.3.9">0.2.0</a>)：<a href="njs-reference.html#writefilesync">crypto.createHash</a>，<a href="njs-reference.html#njs0.3.9">crypto.createHmac</a></p>
</li>
<li>
<p>ES6 模块支持：默认<code>export</code>和默认<code>import</code>语句(<a href="njs-changes.html#njs0.2.0">0.3.0</a>)</p>
</li>
<li>
<p>ES6 箭头功能(<a href="njs-changes.html#crypto_createhash">0.3.1</a>)</p>
</li>
<li>
<p>模板文字：多行字符串，表达式插值，嵌套模板(<a href="njs-changes.html#crypto_createhmac">0.3.2</a>)</p>
</li>
<li>
<p>全局对象(<a href="njs-changes.html#njs0.3.0">0.3.3</a>)：</p>
</li>
<li>
<p><code>globalThis</code>别名(<a href="njs-changes.html#njs0.3.1">0.3.8</a>)，</p>
<ul>
<li><a href="njs-reference.html#njs0.3.2">process</a></li>
</ul>
</li>
</ul>
</div>
</div>
</section>
<div class="right-sidebar">
<div class="affix"><ins class="adsbygoogle" style="display:block" data-ad-client="ca-pub-6108808167664152" data-ad-slot="3102929424" data-ad-format="auto" data-full-width-responsive="true"></ins>
<script>
     (adsbygoogle = window.adsbygoogle || []).push({});
</script></div>
</div>
</div>
<div class="ft">
<a href="#toolbar-title" id="anchorNavigationExGoTop"><i class="fa fa-arrow-up"></i></a>
<footer class="footer">
<div class="footer__container--normal">
<img alt="扫码关注公众号" title="扫码关注公众号" src="static/picture/qr-code.png" width="170" height="170">
<div class="footer__description--normal">
<p class="paragraph footer__author--normal">Docs4dev<sup class="super">&#xAE;</sup>
</p>
<p class="paragraph footer__quote&#45;&#45;normal">
如果你在使用过程中遇到任何问题，可以在 <a href="javascript:window.open('https://github.com/docs4dev/docs4dev-issues');" target="_blank" rel="noopener noreferrer">这里<i class="fa fa-external-link"></i></a> 提issue。
</p>
<div class="footer__main--normal">
<p class="paragraph footer__main__paragraph--normal copyright" style="color: #666 !important;">
<a href="javascript:window.open('https://beian.miit.gov.cn/');">
蜀ICP备14021783号-6
</a>
</p>
<p class="paragraph footer__main__paragraph--normal copyright" style="color: #666 !important;">
Copyright &#xA9; Docs4dev all
right reserved, powered by <a href="index2.html" target="_blank">Docs4dev</a></p>
</div>
</div>
</div>
<div class="box__issues">
</div>
</footer>
</div>
</div>
</div>
</div>
</div>
<script>
  var hasToc = true;
  /*  var downloadable = /!*false*!/ false;
    var editable = /!*false*!/ false;
    var code = /!*"nginx"*!/ false;
    var version = /!*"current"*!/ false;
    var type = /!*"reference"*!/ false;
    var lang = /!*"zh"*!/ 'en';
    //edit link
    require(["gitbook", "jQuery"], function (gitbook, $) {
      gitbook.events.bind('start', function (e, config) {
        // Add edit toolbar to left
        var chapterId = /!*17765*!/ 0;
        if (downloadable) {
          gitbook.toolbar.createButton({
            icon: 'fa fa-download',
            text: '下载',
            onClick: function () {
              window.open('/download?code=' + code + '&version=' + version + '&type=' + type + '&lang=' + lang);
            }
          });
        }
        if (editable) {
          gitbook.toolbar.createButton({
            icon: 'fa fa-edit',
            text: '编辑此页',
            onClick: function () {
              window.open('/docs/edit?chapterId=' + chapterId + '&lang=' + lang);
            }
          });
        }
      });
    });*/
</script>
<script>
    var code = "nginx";
    var lang = "zh";
  </script>

<script src="static/js/autocomplete-js.js"></script>
<script src="static/js/app.min.js"></script>
<script src="static/js/search.min.js"></script>
</body>
</html>
